<include file="header" />

<body class="register-bg">
<div class="wraper bottom-none">
    <div class="load">
        <img class="load-bee" src="/assets/base/repair/images/load-bee.png"/>

    </div>
    <a href="javascript:history.back(-1)" class="back"><img src="/assets/base/center/images/return.png"/></a>
    <div class="identity"><img src="/assets/base/center/images/teacher.png"/></div>
    <div class="form-child clearfix">
        <span class="pull-left">工号</span>
        <input class="pull-left" placeholder="请输入您的工号" id="number" value="{BEESCRM:$data['number']}">
    </div>
    <div class="form-child clearfix">
        <span class="pull-left">姓名</span>
        <input class="pull-left" placeholder="请输入您的真实姓名" id="username" value="{BEESCRM:$data['username']}">
    </div>
    <div class="form-child clearfix">
        <span class="pull-left">手机</span>
        <input class="pull-left" placeholder="请输入您的手机号码" id="mobile" value="{BEESCRM:$data['mobile']}">
    </div>
    <a href="#" class="register-btn"><img src="/assets/base/center/images/btn.png"/></a>
    <if condition="$remark">
        <include file="remark"/>
    </if>
    <div class="bottom-box">
        <p class="copyright">杭州青橄榄网络技术有限公司 技术支持</p>
    </div>
</div>

<include file="commonJS" />
<script>
    var height = $(window).height();
    var bottombox_height = $('.bottom-box').outerHeight();
    $('.wraper').css("minHeight",height);
    $('.wraper').css("paddingBottom",bottombox_height);

    var height = $(window).height();
    $('.wraper').css('minHeight',height);
    $(function(){
		$('.register-btn').click(function(){
			var data={};
			var verify_method = /^(?:13\d|15\d|18\d|17\d|14\d)\d{5}(\d{3}|\*{3})$/;
			data.username=$('#username').val();
    		data.mobile=$('#mobile').val();
    		data.number=$('#number').val();
    		data.register_id=$('#register_id').val();
    		if (!data.number || data.number.length>15) {
            	$.alert('error','请输入正确的学号或工号');
            	return false;
    		}else if (!data.username) {
           		$.alert('error','姓名不能为空');
           		return false;
            }else if(!data.mobile){
    	        $.alert('error','手机号不能为空');
    	        return false;
            }else if (!verify_method.test(data.mobile)) {
            	$.alert('error','请输入正确的手机号');
            	return false;
            }
			var json={};
			json.method='post';
			json.type='json';
			json.url="{BEESCRM::U('/base/center/tReg',array('wechat_id'=>$wechat_id))}";
			json.data=data;
			$.getAjax(json,true,reload,'');
		});
		function reload(){
    		setTimeout('location.href="{BEESCRM::U('/base/center/center',array('wechat_id'=>$wechat_id))}"',3000);
    	}
	})
</script>
</body>
</html>